<?php
namespace MyModel;
use MyBase\BaseModel;
class JoinModel extends BaseModel{

	/**
	 * 根据条件获取相应的记录
	 */
	public function getJoinList($offset=0,$limit=4){
		return $this->limit($offset,$limit)->select();
	}
	/**
	 * 获取所有的记录
	 */
	public function getJoinAll(){
		return $this->select();
	}
	/**
	 * 增加一条记录
	 */
	public function addJoin($data){
		return $this->add($data);
	}

	/**
	 * 获取记录数
	 */
	public function getJoinListNum(){
		$res = $this->field("count(*) as num")->select();
		return $res[0]['num'];
	}

	/**
	 * 获取一条记录
	 */
	public function getJoinInfoById($id){
		$res = $this->where("join_id = $id")->find();
		return $res;
	}
}